<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Alexa Auto SDK: aace::contactUploader::ContactUploader Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="aace-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Alexa Auto SDK
   &#160;<span id="projectnumber">2.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>aace</b></li><li class="navelem"><b>contactUploader</b></li><li class="navelem"><a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html">ContactUploader</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classaace_1_1contact_uploader_1_1_contact_uploader-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">aace::contactUploader::ContactUploader Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:ace68da7d67191dbd4df87a8a7274dcf5"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html#ace68da7d67191dbd4df87a8a7274dcf5">ContactUploaderStatus</a> = aace::contactUploader::ContactUploaderEngineInterface::ContactUploaderStatus</td></tr>
<tr class="separator:ace68da7d67191dbd4df87a8a7274dcf5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a542e1b6b49003f9f550178c8ecfb50a6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html#a542e1b6b49003f9f550178c8ecfb50a6">addContactsBegin</a> ()</td></tr>
<tr class="separator:a542e1b6b49003f9f550178c8ecfb50a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ed1fe8a3b3eff4988c24b5187cf0298"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html#a4ed1fe8a3b3eff4988c24b5187cf0298">addContactsEnd</a> ()</td></tr>
<tr class="separator:a4ed1fe8a3b3eff4988c24b5187cf0298"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a83daa6d9078fd4a662afb6deb102c7bf"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html#a83daa6d9078fd4a662afb6deb102c7bf">addContactsCancel</a> ()</td></tr>
<tr class="separator:a83daa6d9078fd4a662afb6deb102c7bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2b69454f9157b11c7e022d0e3d554671"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html#a2b69454f9157b11c7e022d0e3d554671">addContact</a> (const std::string &amp;contact)</td></tr>
<tr class="separator:a2b69454f9157b11c7e022d0e3d554671"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3fa5b4ad76872e3f3aa39d5c54dbf7f6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html#a3fa5b4ad76872e3f3aa39d5c54dbf7f6">removeUploadedContacts</a> ()</td></tr>
<tr class="separator:a3fa5b4ad76872e3f3aa39d5c54dbf7f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a739b78e1378111c68e5df42e0cc3f1e4"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html#a739b78e1378111c68e5df42e0cc3f1e4">contactsUploaderStatusChanged</a> (<a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html#ace68da7d67191dbd4df87a8a7274dcf5">ContactUploaderStatus</a> status, const std::string &amp;info)=0</td></tr>
<tr class="separator:a739b78e1378111c68e5df42e0cc3f1e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html">ContactUploader</a> should be extended to upload the local (aka native) contacts to the Alexa Cloud. <a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html">ContactUploader</a> Engine uploads the contacts to the Alexa Cloud in batches. The Engine API blocks calls, so platform implementation should make sure <a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html">ContactUploader</a> is called on a separate process other then the user interface thread.</p>
<p>The platform implementation is notified about the status of the upload by <code>contactsUploaderStatusChanged</code>. </p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="ace68da7d67191dbd4df87a8a7274dcf5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ace68da7d67191dbd4df87a8a7274dcf5">&#9670;&nbsp;</a></span>ContactUploaderStatus</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">using aace::contactUploader::ContactUploader::ContactUploaderStatus =  aace::contactUploader::ContactUploaderEngineInterface::ContactUploaderStatus</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Describes the status of contact uploader. </p><dl class="section see"><dt>See also</dt><dd><code>aace::contactUploader::ContactUploaderEngineInterface::ContactUploadStatus</code> </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a542e1b6b49003f9f550178c8ecfb50a6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a542e1b6b49003f9f550178c8ecfb50a6">&#9670;&nbsp;</a></span>addContactsBegin()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool aace::contactUploader::ContactUploader::addContactsBegin </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the Engine to begin the contact upload.</p>
<p>After returning <code>true</code>, the Engine will remove the previously uploaded contacts, if any, and the platform implementation may start calling <code>addContact</code> to upload the contacts.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> on successful start, <code>false</code> if previous upload is in progress or due to any internal error. </dd></dl>

</div>
</div>
<a id="a4ed1fe8a3b3eff4988c24b5187cf0298"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4ed1fe8a3b3eff4988c24b5187cf0298">&#9670;&nbsp;</a></span>addContactsEnd()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool aace::contactUploader::ContactUploader::addContactsEnd </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the Engine about the completion of the contact upload.</p>
<p>The platform implementation to call this when all the contacts are uploaded via </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html#a2b69454f9157b11c7e022d0e3d554671">addContact</a>. Engine on returning <code>true</code>, will not accept any contact and shall notify the platform implementation </dd>
<dd>
<a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html#a739b78e1378111c68e5df42e0cc3f1e4">contactsUploaderStatusChanged</a> about the status of upload.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> on successful, <code>false</code> if no upload in progress or due to any internal error. </dd></dl>

</div>
</div>
<a id="a83daa6d9078fd4a662afb6deb102c7bf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a83daa6d9078fd4a662afb6deb102c7bf">&#9670;&nbsp;</a></span>addContactsCancel()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool aace::contactUploader::ContactUploader::addContactsCancel </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the Engine to cancel the upload which is in progress.</p>
<p>The platform implementation can call this anytime to cancel the contact upload when it is in progress. Engine on returning , will not accept any contact, and shall notify the platform implementation </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html#a739b78e1378111c68e5df42e0cc3f1e4">contactsUploaderStatusChanged</a> about the cancel status and it shall also remove any partial uploaded contacts from Alexa Cloud.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> on successful, <code>false</code> if no upload in progress or due to any internal error. </dd></dl>

</div>
</div>
<a id="a2b69454f9157b11c7e022d0e3d554671"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2b69454f9157b11c7e022d0e3d554671">&#9670;&nbsp;</a></span>addContact()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool aace::contactUploader::ContactUploader::addContact </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>contact</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the Engine to upload the contact.</p>
<p>Engine on returning <code>true</code> shall queue this contact for uploading in batches.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">contact</td><td>Details of one contact to upload in structured JSON format. See the following payload structure and the description of each field: <div class="fragment"><div class="line">)</div><div class="line">{</div><div class="line">     &quot;id&quot; : &quot;{{STRING}}&quot;,</div><div class="line">     &quot;firstName&quot; : &quot;{{STRING}}&quot;,</div><div class="line">     &quot;lastName&quot; : &quot;{{STRING}}&quot;,</div><div class="line">     &quot;nickName&quot; : &quot;{{STRING}}&quot;</div><div class="line">     &quot;company&quot; : &quot;{{STRING}}&quot;,</div><div class="line">     &quot;addresses&quot; : [</div><div class="line">         {</div><div class="line">             &quot;type&quot; : &quot;{{STRING}}&quot;,</div><div class="line">             &quot;value&quot; : &quot;{{STRING}}&quot;,</div><div class="line">             &quot;label&quot; : &quot;{{STRING}}&quot;</div><div class="line">         }</div><div class="line">     ]</div><div class="line">}</div></div><!-- fragment --> <ul>
<li>id (required): A unique identifier for the contact in the platform contact store. </li>
<li>firstName (optional): The first name of the contact. Limit is 1000 characters. </li>
<li>lastName (optional): The last name of the contact. Limit is 1000 characters. </li>
<li>nickName (optional): The nick name of the contact. Limit is 1000 characters. </li>
<li>company (optional): The company name of the contact. Limit is 1000 characters. </li>
<li>addresses (required): The address information of the contact. At least one address required to be specified. </li>
<li>addresses.type (required): Supported address type is "phonenumber" only. And the max supported phone number per contact is 30. </li>
<li>addresses.value (required): The phone number of the contact. Limit is 100 characters. </li>
<li>addresses.label (optional): The type value of the phone number like HOME. MOBILE, Phone1.</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if successfully queued, <code>false</code> when contact format is not valid, upload not started or for any internal error. </dd></dl>

</div>
</div>
<a id="a3fa5b4ad76872e3f3aa39d5c54dbf7f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3fa5b4ad76872e3f3aa39d5c54dbf7f6">&#9670;&nbsp;</a></span>removeUploadedContacts()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool aace::contactUploader::ContactUploader::removeUploadedContacts </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the Engine to remove the uploaded local contacts from the Alexa Cloud. This API to be called when the local contacts become unavailable (Example use case, Phone is disconnected from the Head Unit) and contacts were already successfully uploaded to Alexa Cloud.</p>
<p>Engine on returning <code>true</code> shall notify the platform implementation about the removal status of contacts via </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html#a739b78e1378111c68e5df42e0cc3f1e4">contactsUploaderStatusChanged</a>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> on successful, <code>false</code> if upload is in progress or due to any internal error. </dd></dl>

</div>
</div>
<a id="a739b78e1378111c68e5df42e0cc3f1e4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a739b78e1378111c68e5df42e0cc3f1e4">&#9670;&nbsp;</a></span>contactsUploaderStatusChanged()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void aace::contactUploader::ContactUploader::contactsUploaderStatusChanged </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classaace_1_1contact_uploader_1_1_contact_uploader.html#ace68da7d67191dbd4df87a8a7274dcf5">ContactUploaderStatus</a>&#160;</td>
          <td class="paramname"><em>status</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Notifies the platform implementation about status that occurred while uploading the batch of contacts or while removing the uploaded contacts.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">status</td><td>The <code>ContactUploaderStatus</code> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">info</td><td>The string with additional information. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<html>
  <body>
    <hr style="height:1px;border-width:0;color:gray;background-color:gray">
    <p style="text-align:left;">
      Alexa Auto SDK 2.2.0 - Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
      <span style="float:right;">
        Licensed under the <a HREF=http://aws.amazon.com/apache2.0/>Apache License, Version 2.0</a>
      </span>
    </p>
  </body>
</html>
